-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding currency rate for the central bank of Iceland #494
base: master
Are you sure you want to change the base?
Conversation
const name = tds.eq(0).text() | ||
|
||
if (name) { | ||
currencies.push({ | ||
shortName: name, | ||
longName: tds.eq(1).text(), | ||
value: tds.eq(4).text(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the html has changed. The table only has 3 columns now so the indexes in the tds.eq
calls are wrong.
const name = tds.eq(0).text() | |
if (name) { | |
currencies.push({ | |
shortName: name, | |
longName: tds.eq(1).text(), | |
value: tds.eq(4).text(), | |
const name = tds.eq(1).text() | |
if (name) { | |
currencies.push({ | |
shortName: name, | |
longName: tds.eq(0).text().trim(), | |
value: Number(tds.eq(2).text().replace(',', '.')), |
I'm not sure if the if
on line 23 is still valid now that name
is from column index 1.
it('should return an array of objects containing correct fields', (done) => { | ||
const params = helpers.testRequestParams('/currency/cb') | ||
const resultHandler = helpers.testRequestHandlerForFields(done, fieldsToCheckFor) | ||
request(params, resultHandler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing mock data for this test.
Here's an example of how to do it: https://github.com/apis-is/apis/blob/1fb161a/endpoints/horses/tests/integration_test.js#L22-L4
Adding a new source for the currency endpoint: the currency rate from the Central Bank of Iceland.
Checklist